home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1996 / MacHack 1996.toast / Hacks / Hacks ’91 / AliasThis! / AliasThisƒ / src / Sample.h next >
Encoding:
C/C++ Source or Header  |  1990-09-25  |  5.3 KB  |  167 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2. #
  3. #    Apple Macintosh Developer Technical Support
  4. #
  5. #    MultiFinder-Aware Simple Sample Application
  6. #
  7. #    Sample
  8. #
  9. #    Sample.h    -    Rez and C Include Source
  10. #
  11. #    Copyright © 1989 Apple Computer, Inc.
  12. #    All rights reserved.
  13. #
  14. #    Versions:
  15. #                1.00                08/88
  16. #                1.01                11/88
  17. #                1.02                04/89    MPW 3.1
  18. #                2.00                09/90    7.0 Happy
  19. #
  20. ------------------------------------------------------------------------------*/
  21. #ifndef __SAMPLE__
  22. #define __SAMPLE__
  23. /*    These #defines correspond to values defined in the Pascal source code.
  24.     Sample.c and Sample.r include this file. */
  25.  
  26. #define kMinSize    150                /* application's minimum size (in K) */
  27. #define kPrefSize    200                /* application's preferred size (in K) */
  28.  
  29. #define    rMenuBar    128                /* application's menu bar */
  30. #define    rAboutAlert    128                /* about alert */
  31. #define    rUserAlert    129                /* error user alert */
  32. #define    rWindow        128                /* application's window */
  33. #define rStopRect    128                /* rectangle for Stop light */
  34. #define rGoRect        129                /* rectangle for Go light */
  35.  
  36. /* kSysEnvironsVersion is passed to SysEnvirons to tell it which version of the
  37.    SysEnvRec we understand. */
  38.  
  39. #define    kSysEnvironsVersion        2
  40.  
  41. /* kOSEvent is the event number of the suspend/resume and mouse-moved events sent
  42.    by MultiFinder. Once we determine that an event is an osEvent, we look at the
  43.    high byte of the message sent to determine which kind it is. To differentiate
  44.    suspend and resume events we check the resumeMask bit. */
  45.  
  46. #define    kOSEvent                app4Evt    /* event used by MultiFinder */
  47. #define    kSuspendResumeMessage    1        /* high byte of suspend/resume event message */
  48. #define    kResumeMask                1        /* bit of message field for resume vs. suspend */
  49. #define    kMouseMovedMessage        0xFA    /* high byte of mouse-moved event message */
  50. #define    kNoEvents                0        /* no events mask */
  51.  
  52. /* The following constants are used to identify menus and their items. The menu IDs
  53.    have an "m" prefix and the item numbers within each menu have an "i" prefix. */
  54.  
  55. #define    mApple                    128        /* Apple menu */
  56. #define    iAbout                    1
  57.  
  58. #define    mFile                    129        /* File menu */
  59. #define    iNew                    1
  60. #define iOpen                    2
  61. #define    iClose                    4
  62. #define iSave                    5
  63. #define    iSaveAs                    6
  64. #define iRevert                    7
  65. #define    iPageSetup                9
  66. #define    iPrint                    10
  67. #define    iQuit                    12
  68.  
  69. #define    mEdit                    130        /* Edit menu */
  70. #define    iUndo                    1
  71. #define    iCut                    3
  72. #define    iCopy                    4
  73. #define    iPaste                    5
  74. #define    iClear                    6
  75.  
  76. #define    mLight                    131        /* Light menu */
  77. #define    iStop                    1
  78. #define    iGo                        2
  79.  
  80. /*    1.01 - kTopLeft - This is for positioning the Disk Initialization dialogs. */
  81.  
  82. #define kDITop                    0x0050
  83. #define kDILeft                    0x0070
  84.  
  85. /*    1.01 - kMinHeap - This is the minimum result from the following
  86.     equation:
  87.  
  88.         ORD(GetApplLimit) - ORD(ApplicZone)
  89.  
  90.     for the application to run. It will insure that enough memory will
  91.     be around for reasonable-sized scraps, FKEYs, etc. to exist with the
  92.     application, and still give the application some 'breathing room'.
  93.     To derive this number, we ran under a MultiFinder partition that was
  94.     our requested minimum size, as given in the 'SIZE' resource. */
  95.  
  96. #define kMinHeap                21 * 1024
  97.  
  98. /*    1.01 - kMinSpace - This is the minimum result from PurgeSpace, when called
  99.     at initialization time, for the application to run. This number acts
  100.     as a double-check to insure that there really is enough memory for the
  101.     application to run, including what has been taken up already by
  102.     pre-loaded resources, the scrap, code, and other sundry memory blocks. */
  103.  
  104. #define kMinSpace                8 * 1024
  105.  
  106. /* kExtremeNeg and kExtremePos are used to set up wide open rectangles and regions. */
  107.  
  108. #define kExtremeNeg                -32768
  109. #define kExtremePos                32767 - 1 /* required to address an old region bug */
  110.  
  111. /* these #defines are used to set enable/disable flags of a menu */
  112.  
  113. #define AllItems    0b1111111111111111111111111111111    /* 31 flags */
  114. #define NoItems        0b0000000000000000000000000000000
  115. #define MenuItem1    0b0000000000000000000000000000001
  116. #define MenuItem2    0b0000000000000000000000000000010
  117. #define MenuItem3    0b0000000000000000000000000000100
  118. #define MenuItem4    0b0000000000000000000000000001000
  119. #define MenuItem5    0b0000000000000000000000000010000
  120. #define MenuItem6    0b0000000000000000000000000100000
  121. #define MenuItem7    0b0000000000000000000000001000000
  122. #define MenuItem8    0b0000000000000000000000010000000
  123. #define MenuItem9    0b0000000000000000000000100000000
  124. #define MenuItem10    0b0000000000000000000001000000000
  125. #define MenuItem11    0b0000000000000000000010000000000
  126. #define MenuItem12    0b0000000000000000000100000000000
  127.  
  128.  
  129. /* addition to sample */
  130. #define    ERR_DLOG_ID    200
  131. #define A_USERITEM    2
  132. #define sErrorOccurred 1            /* Strings to display in the user item */
  133. #define sErrorNumber 2
  134. #define sEventWhat 3
  135. #define sEventMessage 4
  136. #define sMessageID 5
  137.  
  138. #define    ELAPSED_DLOG_ID    201
  139. #define sElapsedTime 1
  140.  
  141. #define traeMoveFrontWindowMsgID    'MVFW'
  142. #define traeEchoID 'ECHO'
  143.  
  144. #define oappCursor        256
  145. #define odocCursor        257
  146. #define pdocCursor        258
  147. #define quitCursor        259
  148. #define ansrCursor        260
  149. #define mvfwCursor        261
  150. #define echoCursor        262
  151.  
  152. /* menu constants for apple events */
  153. #define mSendEvent 132
  154. #define    iChooseTarget    1
  155. #define    iSendClose        3
  156. #define iSendMove        4
  157. #define iSpeedTest        6
  158. #define iUseNoReply        7
  159. #define iUseWaitReply    8
  160. #define iUseQueueReply    9
  161.  
  162. /* miscellaneous string list ID */
  163. #define kMiscStrings 366
  164. #define kSFprompt 1
  165. #define    korigName 2
  166.  
  167. #endif __SAMPLE__